<template>

  <!-- <el-backtop >
    <div
      style="{
        height: 100%;
        width: 100%;
        background-color: #f2f5f6;
        box-shadow: 0 0 6px rgba(0,0,0, .12);
        text-align: center;
        line-height: 40px;
        color: #1989fa;
      }"
    >
      UP
    </div>
  </el-backtop> -->
  <div class="rightAside" ref="a">
    <div class="content" @click="goCart">
      <i class="el-icon-shopping-cart-1"></i>
      <p>购物车</p>
    </div>
    <div class="content">
      <i class="el-icon-service"></i>
      <p>在线客服</p>
    </div>
    <div class="content" @click="toTop">
      <i class="el-icon-top"></i>
      <p>返回顶部</p>
    </div>
  </div>
</template>

<script>

export default {
  name: "RightAside",
  data() {
    return {
      top: 0
    }
  },
  methods: {
    // 去购物车页面
    goCart() {
      this.$router.push({
        name:"cart",
      })
     },
    // 滚动去头部
    toTop() {
      window.scrollTo({
        top: 0,
        behavior: "smooth",
      });
    }
  },
}

</script>

<style lang='scss' scoped>
@function vw($w) {
  @return ($w/1349) * 100+vw;
}

.rightAside {
  opacity: 1;
  width: vw(70);
  height: vw(270);
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  text-align: center;
  position: fixed;
  z-index: 99;
  bottom: vw(40);
  right: vw(10);

  .active {
    opacity: 1;
  }

  .content {
    width: 100%;
    height: vw(68);
    color: #999;
    cursor:pointer;

    i {
      font-size: vw(30);
    }

    &:hover {
      color: red;
    }
  }

}
</style>
